package com.zyh.server.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zyh.server.entity.Goods;
import com.zyh.server.service.GoodsService;
import com.zyh.server.mapper.GoodsMapper;
import com.zyh.server.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author ZYH
* @description 针对表【t_goods】的数据库操作Service实现
* @createDate 2024-11-14 11:27:48
*/
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods>
    implements GoodsService{

	@Autowired
	private GoodsMapper goodsMapper;

	@Override
	public R findAllGoods(Integer pageNum, Integer pageSize) {
		Page<Goods> page = new Page<>(pageNum, pageSize);
		IPage<Goods> goodsIPage = goodsMapper.selectAll(page);
		return R.ok().setData(goodsIPage);
	}
}




